import axios from "axios";


/**
 * 添加或更新角色
 * @param data
 */
export function saveOrUpdateRole(data: any) {
    return axios.post("/sys/role/saveOrUpdate", data);
}

/**
 * 根据角色code删除角色
 * @param params
 */
export function deleteRoleByCode(params: any) {
    return axios.delete("/sys/role/delete/code", {
        params: params
    });
}

/**
 * 分页查询角色
 */
export function getPageRole(params: any) {
    return axios.get("/sys/role/list/page", {
        params: params
    });
}

export function getAllRole(params: any) {
    return axios.get("/sys/role/list/all", {
        params: params
    });
}

export function getAllRolePermission(params: any) {
    return axios.get("/sys/role/permission/list/all", {
        params: params
    });
}

export function saveOrUpdateRolePermission(data: any) {
    return axios.post("/sys/role/permission/saveOrUpdate", data);
}
